﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using VRacer.Packets;

namespace VRacer
{
    /// <summary>
    /// Symuluje ruchy gracza po stronie serwera. Czyli defakto reaguje na instrukcje klasy RemoteGame a ignoruje wszlekie akcje ze strony lokalnego gracza.
    /// </summary>
    public class RemotePlayer : PlayerBase, ITimeStatistics
    {
        private TimeStatistics _timeStats = new TimeStatistics();
        private int _version;

        public RemotePlayer(NewPlayerPacket newPlayer)
        {
            this.ID = newPlayer.ID;
            this.Title = newPlayer.Title;
            this.Version = newPlayer.Version;
        }

        public int Version
        {
            get { return _version; }
            set { _version = value; }
        }

        public override void Crash(System.Windows.Point crashPoint)
        {
            base.Crash(crashPoint);
        }

        public override void Crash(System.Windows.Point crashPoint, System.Windows.Point startPoint)
        {
            base.Crash(crashPoint, startPoint);
        }

        public override void EndTurn()
        {
            base.EndTurn();
            _timeStats.End();
        }

        public override void Hit(PlayerBase player)
        {
            base.Hit(player);
        }

        public override void Move(System.Windows.Point point)
        {
            
        }

        public override void StartTurn()
        {
            base.StartTurn();
            _timeStats.Start();
        }

        #region ITimeStatistics Members

        TimeStatistics ITimeStatistics.Statistics
        {
            get { return _timeStats; }
        }

        #endregion
    }
}
